eWVERSION = 3.00!Arial, 0, 9, 5, 15, 12, 21, 3, 0 _cmdhelpPixelsgraphics\help.bmpgraphics\help.bmpGBrings up the help file, searching for the HelpContextID of the controlClass1_cmdok_commandbutton_cmdhelp 4%UUNERRORCMETHODNLINE$IUTHIS HELPCONTEXTIDError,ClickZ1333Om)xPROCEDURE Error LPARAMETERS nerror,cmethod,nline ENDPROC PROCEDURE Click HELP ID This.HelpContextID ENDPROC SHeight = 30 Width = 94 Caption = "\ Root Entry VPAsOleObjectData,AccessObjSiteData&\ChangedProps , DEST!C4PrW\$8mgkgtgnnmnmninigthkgogggvmkhinjggnvm ࡱ> Root EntryNAsOleObjectData0AccessObjSiteData&\ChangedProps , DEST!C40W\$8mgkgtgnnmnmninigthkgogggvmkhinjggnvm nn9%oDU5%CC&i9C*No table is open in the current work area.0xB%C B% T  C  T(C 6%CC >2TCC >  T(C MTCCC f&TC: !if !isnull(&lvFieldValue), H(B C NC B C F jGlcMessageText = lcMessageText + alltrim(str(&lvFieldValue))+chr(13)  C YNlcMessageText = lcMessageText+"$"+alltrim(str(&lvFieldValue,10,2))+chr(13) . C CC M @@lcMessageText=lcMessageText + alltrim(&lvFieldValue)+chr(13)  C G\TEGeneral fields are not supported in this example and will be skipped.C  C DGlcMessageText=lcMessageText + alltrim(DTOC(&lvFieldValue))+chr(13)  C TyHlcMessageText = lcMessageText + alltrim(TTOC(&lvFieldValue))+chr(13)  C Lif &lvFieldValueTTRUEC TFALSEC 2(2TField could not be printed.C ITNULLT 1T CC&: Record #CCCOZC %  UJ LNMAXLENGTHI LCMESSAGETEXT LVFIELDVALUEARRAYTHISPARENTSIGNON LOGSESSIONOLEMMESS SESSIONIDOLEMSESS PADBFIELDSCOMPOSEADDTABS MSGNOTETEXT MSGSUBJECTSENDSIGNOFFXCCE0x%@T-UNERRORCMETHODNLINETHISPARENT LOGSESSIONOLEMSESSSIGNOFFClick,Error1pqsAQAA1AAa!qqA!AQAAaa1AAA31A2r=+y)nllogsession Whether successful login to mail. *addtabs Adds tabs to the strings. *signon Signs onto mail. %lsetcaption Automatically set caption based on cfilename. cfilename Name of report to run. luseoutputdialog Whether to displays FFC output dialog. coutputdialogalias Name of output dialog alias. loutputdialogpreventscope Whether to prevent user from changing scope in dialog. loutputdialogpreventsource Whether to prevent user from changing alias/report in dialog. lpromptforreport Whether to ask for report name. cdialogclass Output dialog class. cdialogclasslib Output dialog class library. *showoutputdialog Displays FFC output dialog.  Caption = "\17!1AAAA1AAA!AAA31A2(%D0)uPROCEDURE Error LPARAMETERS nError, cMethod, nLine #DEFINE MSG_DATAIN_LOC "Data in " #DEFINE MSG_CHANGED_LOC "was changed by another user" #DEFINE MSG_SAVE_LOC "Do you want to save your changes anyway?" #DEFINE MSG_CONFLICT_LOC "Data Conflict" LOCAL nField,cField,nChoice,nRec DO CASE CASE nError = 1585 && Update conflict DO CASE CASE INLIST(CURSORGETPROP('Buffering'), 2,3) && Row Buffering FOR nField = 1 to FCOUNT(ALIAS()) cField = FIELD(m.nField) IF OLDVAL(m.cField) != CURVAL(m.cField) nChoice = MESSAGEBOX(MSG_DATAIN_LOC + cField + MSG_CHANGED_LOC + ; CR_LOC + MSG_SAVE_LOC, 4+48, MSG_CONFLICT_LOC) IF m.nChoice = 6 && yes =TABLEUPDATE(.F., .T.) ELSE =TABLEREVERT(.F.) ENDIF ENDIF ENDFOR CASE INLIST(CURSORGETPROP('Buffering'), 4,5) nRec = GETNEXTMODIFIED(0) DO WHILE m.nRec > 0 FOR nField = 1 to FCOUNT(ALIAS()) cField = FIELD(m.nField) IF OLDVAL(cField) != CURVAL(m.cField) nChoice = MESSAGEBOX(MSG_DATAIN_LOC + cField + MSG_CHANGED_LOC + ; CR_LOC + MSG_SAVE_LOC, 4+48, MSG_CONFLICT_LOC) IF m.nChoice = 6 && yes =TABLEUPDATE(.F., .T.) ELSE =TABLEREVERT(.F.) ENDIF ENDIF ENDFOR nRec = GETNEXTMODIFIED(m.nRec) ENDDO ENDCASE ENDCASE ENDPROC PROCEDURE Click IF TYPE("THISFORM.PARENT") = 'O' THISFORMSET.Release ELSE THISFORM.Release ENDIF ENDPROC 6PROCEDURE Click *:********************************************************************* *: *: Class file: \samples\ole\mapibtn.vcx *: *: System: OLE *: Author: Microsoft Corporation *: Created: 01/04/95 *: Last modified: 04/13/95 *: *: *:********************************************************************* * This is sample class which demonstrates how to use the MAPI controls. * * It starts a new Mail session, collects data from the current record, * and brings up the Send Mail dialog with the data inserted as the * message text. * * To use this example, add this class to a form. You will need to open a * table before pressing the Send Mail button. This will work with any * Visual FoxPro table. * * This class includes a custom method addtabs for formatting the * information gathered from the table and inserted in the mail message. * * This class also takes advantage of another custom method called "signon" * as well as a custom property called logsession. This method and property * are necessary for proper error handling of the MAPI server (i.e. MSMail, * Exchange, etc.) * * This class also uses the smmail.bmp and next.bmp as the icons of the button * controls. * * In order for this button to function properly MSMAPI32.OCX must be * correctly registered in the registration database and a mail * application supported by the MAPI controls must be installed. The * MAPI controls do not work with Windows for Workgroups or Windows 3.1. * *********************************************************************** local j, lnMaxLength, i, lcMessageText, lvFieldValue ** j & i are counters private array paDBFields *** Localizable Strings #DEFINE DBF_NOT_FOUND_LOC "No table is open in the current work area." #DEFINE GEN_UNSUPPORT_LOC "General fields are not supported in this example and will be skipped." #DEFINE _FALSE_LOC "FALSE" #DEFINE _TRUE_LOC "TRUE" #DEFINE _NULL_LOC "NULL" #DEFINE _DOLLARSIGN_LOC "$" #DEFINE FLD_NO_PRINT_LOC "Field could not be printed." #DEFINE RECORDNUM_LOC "Record #" * Verify that a table is open in the current work area if empty(dbf()) =messagebox(DBF_NOT_FOUND_LOC,48) return else IF !this.parent.signon() && Use the custom method RETURN ENDIF IF this.parent.LogSession && Check if the user was able to login this.parent.OleMMess.sessionid=this.parent.OleMSess.sessionid * Get the number of fields in the current table =afields(paDBFields) **** find the longest field string for approximate formatting purposes lnMaxLength = 0 for j = 1 to alen(paDBFields,1) if len(paDBFields(j,1))+2 > lnMaxLength lnMaxLength = len(paDBFields(j,1))+2 endif endfor * Start a new mail message and build the text this.parent.OleMMess.compose lcMessageText="" for i = 1 to alen(paDBFields,1) lvFieldValue=alltrim(upper(paDBFields(i,1))) lcMessageText=lcMessageText+this.parent.addtabs((lvFieldValue+": "),lnMaxLength) if !isnull(&lvFieldValue) do case case paDBFields(i,2)= "N" or paDBFields(i,2)= "B" or paDBFields(i,2)= "F" lcMessageText = lcMessageText + alltrim(str(&lvFieldValue))+chr(13) case paDBFields(i,2) = "Y" lcMessageText = lcMessageText+_DOLLARSIGN_LOC+alltrim(str(&lvFieldValue,10,2))+chr(13) case paDBFields(i,2)= "C" or paDBFields(i,2) = "M" lcMessageText=lcMessageText + alltrim(&lvFieldValue)+chr(13) case paDBFields(i,2)= "G" lcMessageText=lcMessageText+GEN_UNSUPPORT_LOC+chr(13) case paDBFields(i,2) = "D" lcMessageText=lcMessageText + alltrim(DTOC(&lvFieldValue))+chr(13) case paDBFields(i,2) = "T" lcMessageText = lcMessageText + alltrim(TTOC(&lvFieldValue))+chr(13) case paDBFields(i,2) = "L" if &lvFieldValue lcMessageText = lcMessageText+_TRUE_LOC+chr(13) else lcMessageText = lcMessageText+_FALSE_LOC+chr(13) endif otherwise lcMessageText = lcMessageText+FLD_NO_PRINT_LOC+chr(13) endcase else lcMessageText=lcMessageText+_NULL_LOC endif endfor this.parent.OleMMess.msgnotetext=lcMessageText this.parent.OleMMess.msgsubject=justfname(dbf())+": "+RECORDNUM_LOC+alltrim(str(recno())) this.parent.OleMMess.send(1) IF this.parent.logsession this.parent.OleMSess.signoff ENDIF && Session Handle test ENDIF && Login Test endif && DBF Test ENDPROC PROCEDURE Error LPARAMETERS nError, cMethod, nLine =messageb(message(),48) IF this.parent.logsession this.parent.OLEMSess.signoff ENDIF this.parent.logsession = .F. ENDPROC  ffq% UTC%CO9B TTT T  T C CULOFORMTHIS CDIALOGCLASSCDIALOGCLASSLIBCREPORT CFILENAMECALIASCOUTPUTDIALOGALIASLPREVENTSCOPECHANGESLOUTPUTDIALOGPREVENTSCOPELPREVENTSOURCECHANGESLOUTPUTDIALOGPREVENTSOURCE CUSOUTPUTCBODESTINATIONSVALUE ADESTINATIONSSHOWs8%CfC \ 8(tTC  BUTCSTRING TNMAXLENGTHILNADD LNMAXTABSTaX%CCWINDIR5\SYSTEM32\MAPI32.DLL0 %CCWINDIR5\SYSTEM\MAPI32.DLL0 SCGIt does not appear that you have MAPI installed. Mail could not be run.xB- UTHIS LOGSESSIONOLEMSESSSIGNONT-UTHIS LOGSESSION Cz%CCeCC0x{CCE0xT-UNERRORCMETHODNLINEAERRSTHIS LOGSESSIONaddtabs,signonInitError1qq1A21qA32qaA18 U )PROCEDURE addtabs parameters tcString, tnMaxLength #DEFINE TABSPACES 8 && Number of characters that will equal 1 TAB local i, lnAdd, lnMaxTabs lnMaxTabs=int(tnMaxLength/TABSPACES)+1 lnAdd = lnMaxTabs - INT(len(tcString)/TABSPACES) for i = 1 to lnAdd tcString = tcString + chr(9) endfor return tcString ENDPROC PROCEDURE signon #DEFINE ERR_NOMAPI_LOC "It does not appear that you have MAPI installed. Mail could not be run." this.logsession = .T. IF !FILE(GETENV("WINDIR")+"\SYSTEM32\MAPI32.DLL"); AND !FILE(GETENV("WINDIR")+"\SYSTEM\MAPI32.DLL") MESSAGEBOX(ERR_NOMAPI_LOC) RETURN .F. ENDIF this.OLEMSess.signon ENDPROC PROCEDURE Init this.logsession = .F. ENDPROC PROCEDURE Error LPARAMETERS nError, cMethod, nLine LOCAL aErrs DIMENSION aErrs[1] AERROR(aErrs) IF BETWEEN(aErrs[1,1],1420,1450) MESSAGEBOX(aErrs[1,3],48) ELSE MESSAGEBOX(message(),48) ENDIF this.logsession = .F. ENDPROC